SUBROUTINE objfcn_mayor(p, fval)
  USE commonvars
  IMPLICIT NONE

  REAL(8), INTENT(IN)     :: p(:)
  REAL(8), INTENT(OUT)    :: fval
  INTEGER                 :: n 

  EXTERNAL mayorsolution
  
  n=size(p, dim=1)

  CALL mayorsolution(n, p, fval)

END SUBROUTINE objfcn_mayor
